package com.lbd.statistics.controller;

/**
 * Created by Yuanbo on 2016/10/8.
 * <p>
 * 折线图
 *
 * @return 折线图
 * @return
 *//*
@RestController
@RequestMapping("/statistics")
public class EcharsController {
    *//**
 * 折线图
 *
 * @return
 *//*
    @RequestMapping(value = "/showLine", method = RequestMethod.GET)
    public String show(@RequestParam(value = "title") String title, @RequestParam(value = "yName") String yName, @RequestParam(value = "ySplitNumber") int ySplitNumber, @RequestParam(value = "yMax") int yMax,@RequestParam(value = "xName") String xName) {
        Option option = new Option();
        option.title().text(title).x(X.center);
        option.legend().x(X.left).data(title);
        option.toolbox().show(true).feature(
                Tool.mark,
                Tool.dataView, //数据视图
                new MagicType(Magic.line, Magic.bar), //折线图、柱形图
                Tool.restore,//还原
                Tool.saveAsImage  //保存为图片
        );
        option.tooltip().trigger(Trigger.item).formatter("{a}<br/>{b}:{c}");
        //是否启用拖拽重计算特性，默认关闭
        option.calculable(true);
        //y轴
        ValueAxis valueAxis = new ValueAxis();
        valueAxis.name(yName);
        valueAxis.splitNumber(ySplitNumber);//分割断数
        valueAxis.max(yMax);
        option.yAxis(valueAxis);
        //x轴
        CategoryAxis categoryAxis = new CategoryAxis();
        categoryAxis.name(xName).splitLine().show(false); //纵向背景线不显示
        if(xName.equals("月份")){
            categoryAxis.data("1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12");
        }
        option.xAxis(categoryAxis);
        Line line = new Line(title);
        line.data(77, 36, 96, 76, 81, 47, 7, 22, 69, 12);
        option.series(line).color("#283b5b");
        String str = JSON.toJSONString(option);
        return str;
    }


}*/
